package com.zjj.day0425.regex;

/**
 * @author zhoujunjie
 * @desc TODO
 * @date 2025/4/25
 */
public class StringSplittingWithRegex {
    public static void main(String[] args) {
        String ipAddress = "192.168.105.27";
        String[] ipParts = ipAddress.split("\\.");
        System.out.println("按照 . 号切割 192.168.105.27 的结果：");
        for (String part : ipParts) {
            System.out.println(part);
        }

        String numbers = "18 22 40 65";
        String[] numberParts = numbers.split(" ");
        System.out.println("\n按照空格切割 18 22 40 65 的结果：");
        for (String part : numberParts) {
            System.out.println(part);
        }
    }
}